<?php

require_once("WorkoutUpdates/Model/WorkoutUpdateTitle.php");
require_once("WorkoutUpdates/Model/WorkoutUpdateComment.php");

class WorkoutUpdate
{
	private $title;
	private $comment;
	private $updateID;
	private $workoutID;	


	private function __construct($title, $comment, $workoutID, $updateID = null)
	{
		$this->title = $title;
		$this->comment = $comment;
		$this->workoutID = $workoutID;
		
		if($updateID != null)
		{
			$this->updateID; = $updateID;
		}
	}


	public static function createNewWorkout($title, $comment, $workoutID)
	{	
		return new WorkoutUpdate(new WorkoutUpdateTitle($title), new WorkoutUpdateComment($comment), $workoutID);
	}

	public static function createWorkoutFromDatabase($title, $comment, $workoutID, $updateID)
	{
		return new WorkoutUpdate(new WorkoutUpdateTitle($title), new WorkoutUpdateComment($comment), $workoutID, $updateID);
	}



	public function getUpdateID()
	{
		return $this->updateID;
	}

	public function getWorkoutID()
	{
		return $this->workoutID;
	}

	public function getTitle()
	{
		return $this->name->getWorkoutTitle();
	}

	public function getComment()
	{
		return $this->description->getWorkoutComment();
	}

}